<!DOCTYPE html>
<html>
<head>
    {include file="public/header" /}
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <table class="layui-table layui-form">
            <thead>
            <tr>
                <th>发送人</th>
                <th>内容</th>
                <th>时间</th>

            </thead>
            <tbody>
             {volist name="list.content.msgData" id="v"}
            <tr>

                <td>{if condition="$v.userType=='my'"}
                        {$list.send_name}
                    {else/}
                        {$list.receipt_name}
                    {/if}</td>
                <td>
                    {if condition="$v.msgType=='transfer'"}
                    转账=>{$v.num}{$v.mark}
                    {elseif condition = "$v.msgType=='video' || $v.msgType=='img' || $v.msgType=='sound'"}
                    <button class="layui-btn" onclick="checkInfo('{$v.msgText}','{$v.msgType}')"> 查看 -- {$v.msgType}</button>
                    {else/}
                    {$v.msgText}
                    {/if}
                </td>
                <td>{$v.sendTime}</td>


            </tr>
            {/volist}
            </tbody>
        </table>

    </div>
</div>
{include file="public/footer" /}

<script>
    layui.use(['form', 'table','laydate'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table,
            laydate=layui.laydate;
    });

    /*查看信息*/
    function checkInfo(info,mark) {
        if (info != '' && info != null && info != 'null') {
            var htmlInfo = '<div class="wrap" style="width: 100%;height: 100%">';
            if(mark=='video'){
                htmlInfo += '<video  height="100%" width="100%" controls="controls" autobuffer="autobuffer" autoplay="autoplay" loop="loop">';
                htmlInfo += '<source src="'+info+'" type="video/mp4" />';
                htmlInfo += '</video>';
            }else if(mark=='img'){
                htmlInfo+= "<img src='" + info + "' style='width:auto;height:auto; max-width:100%;max-height:100%;margin-left: 29%'>";
            }else if(mark=='sound'){
                htmlInfo += '<audio  height="100%" width="100%" style="margin-left: 23%;margin-top: 37%" controls="controls" autobuffer="autobuffer" autoplay="autoplay" loop="loop">';
                htmlInfo += '<source src="'+info+'" type="audio/mp3" />';
                htmlInfo += '</audio>';
            }
            htmlInfo += '</div>';
            var explainopen = layer.open({
                type: 1,
                title: '查看信息',
                offset: 'auto',
                skin: 'layui-layer-rim', //加上边框
                area: ['600px', '600px'],
                shadeClose: true,
                content: htmlInfo
            });
        } else {
            layer.msg('信息为空');
        }
    }
</script>

</body>
</html>